
<div class="modal-header">
    <h4 class="modal-title">为该优惠券选择可用产品, 优惠金额 {{coupon.money * 0.01 | currency : '￥' }}</h4>
</div>
<div class="modal-body">

<div class="container-fluid">
<div class="col-sm-12 mt20" >
<div class="panel panel-default">
<div class="panel-body">
<div class="col-sm-12">

    <div class="row">
        <div class="col-sm-2">
            <input type="text" class="form-control" ng-model="searchform.code" placeholder="产品编号">
        </div>
        <div class="col-sm-2">
            <input type="text" class="form-control" ng-model="searchform.name" placeholder="产品名称"> 
        </div>
        <div class="col-sm-2">
            
        </div>
        <div class="col-sm-2">
           
        </div>

        <div class="col-sm-2 col-sm-offset-2">
            <button class="btn btn-block btn-info" ng-click="load(searchform)">搜索</button> 
        </div>

    </div>

</div>
</div>
</div>
	<table class="table table-condensed table-hover table-bordered">
        <thead>
            <tr>
                <th class="col-md-6 text-center">产品</th>
                <th class="col-md-1 text-center">成本价格</th>
                <th class="col-md-1 text-center">销售价格</th>
                <th class="col-md-4 text-center">允许使用</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="obj in objs">
                <td class="">
                    {{obj.name}}
                </td>
                <td class="">
                    {{obj.cost_price | currency : '¥'}}
                </td>
                <td class="">
                    {{obj.guide_price | currency : '¥'}}
                </td>
                
                <td class="text-center">
                    
                    <a ng-if="coupon.money * 0.01 <= obj.cost_price" ng-click="opt(obj)" >
                    	<span 
                    	ng-if="obj.voucher_state == 0"
                    	class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span>

                    	<span
                    	ng-if="obj.voucher_state == 1"
                    	class="glyphicon glyphicon-remove text-danger" aria-hidden="true"></span>
                    </a>

                    <span ng-if="coupon.money * 0.01 > obj.cost_price" class="text-danger">
                        优惠券金额大于成本价格，不能使用。
                    </span>


                </td>
                
            </tr>
        </tbody>
    </table>

    <div class="text-right">
         <pagination total-items="bigTotalItems" ng-model="bigCurrentPage" ng-change="load()" previous-text="上一页" next-text="下一页"
            first-text="首页" last-text="尾页" max-size="maxSize" boundary-links="true" rotate="false" items-per-page="itemsPerPage"
            class="m-t-none m-b">
        </pagination>
    </div>
		
</div>

</div>
<div class="modal-footer">
    <button class="btn btn-primary" type="button" ng-click="gogo()">保存</button>
    <button class="btn btn-warning" type="button" ng-click="cancel()">返回</button>
</div>
